package com.hengpeng.itfin.service.impl;

import java.util.Date;

import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hengpeng.itfin.service.SystemLogService;
import com.hengpeng.itfinbase.persist.SystemLog;
import com.hengpeng.itfinbase.persist.SystemLog.LogType;

@Transactional
@Service
@Lazy
public class SystemLogServiceImpl extends BaseServiceImpl implements SystemLogService {

    @Override
    public void addLog(String borrowInfoId, String orderId, LogType type, String content) {
        SystemLog log = new SystemLog();
        log.setType(type);
        log.setOrderId(orderId);
        log.setContent(content);
        log.setCreateTime(new Date());
        log.setUpdateTime(new Date());
        serviceFactory.getPersistService().save(log);
    }
}
